<template>
	<!-- 存货分类下拉框 -->
	<v-combobox v-model="currentSelectInventoryClass" :items="inventoryClassItems" label="选择所属分类"
		:return-object="inventoryClassSelectModel.isReturnObj" @input="inventoryClassSelectEvent" dense outlined chips>
	</v-combobox>
</template>
<script>
	export default {
			name: 'InvclassSelect',
			props: {
				callBack: {
					type: Function, //参数类型：函数
				},
				inventoryClassSelectModel: {
					loadInventoryClassUrl: ``,
					isReturnObj:false
				},
			},
			data: () => ({
				inventoryClassItems: [],
				currentSelectInventoryClass: null
			}),
			created() {
				this.loadInventoryClassItems()
			},
			methods: {
				async loadInventoryClassItems() {
					var response = await this.$httpRequest({
						url: this.inventoryClassSelectModel.loadInventoryClassUrl,
						method: 'get',
					})
	
					if (response.status == 1) {
						this.inventoryClassItems = response.data
					} else {
						this.$message.error('加载存货分类信息失败！')
					}
				},
				inventoryClassSelectEvent(item) {
					this.$props.callBack(item)
				},
	
			}
		}
	
</script>

<style>
</style>
